<?php

namespace App\Http\Requests\Article;

use App\Http\Requests\AbstractApiRequest;
use Dingo\Api\Http\FormRequest;
use Illuminate\Validation\ValidationException;

class Update extends AbstractApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
     public function authorize()
     {
         return true;
     }

      /**
       * Get the validation rules that apply to the request.
       *
       * @return array
       */
      public function rules()
      {
          return [
             'title' => 'sometimes|required',
             'folder_id' => 'sometimes|required',
             'content' => 'sometimes|required',
          ];
      }

      /**
       * 获取已定义验证规则的错误消息。
       *
       * @return array
       */
      public function messages()
      {
         return [
             'title.required' => '标题不能为空',
             'folder_id.required' => '文章类型不能为空',
             'content.required' => '内容不能为空'
          ];
      }
}
